Repository navigation
Conversation
8da23f9 to
3711acb
Compare
Signed-off-by: Matt Katz <mhkatz97@gmail.com>
ddc804c to
571f608
Compare
Signed-off-by: Matt Katz <mhkatz97@gmail.com>
Merging this PR will improve performance by 13.28%
|
| Mode | Benchmark | BASE |
HEAD |
Efficiency | |
|---|---|---|---|---|---|
| ⚡ | WallTime | threshold_avx512[8] |
2.1 µs | 1.8 µs | +15.81% |
| ⚡ | WallTime | bitpack_blocked_compress_avx2 |
7.6 µs | 6.7 µs | +13.41% |
| ⚡ | WallTime | threshold_avx512[64] |
3.2 µs | 2.9 µs | +10.69% |
Tip
Curious why performance improved? Comment @codspeedbot explain why performance improved on this PR, or directly use the CodSpeed MCP with your agent.
Comparing mk/bitpacked-blocked-slice (ae93be8) with develop (d42e7c9)
Signed-off-by: Matt Katz <mhkatz97@gmail.com>
Signed-off-by: Matt Katz <mhkatz97@gmail.com>
Tracking Issue: #10167
Summary
Slicing a
BitPackedarray whose blocks have their own bit widths now runs as a kernel instead of decoding the whole array first. The result stays blocked and holds only the blocks the slice overlaps. Block offsets are relative to the first one, so the kernel reads three boundaries and slices the offsets child and the packed buffer without copying.Changes
SliceKernelslices blocked arrays;SliceReducestill declines them, since it can't read buffers.Primitiveoffsets are read directly; other encodings go throughexecute_scalar.Benchmarks
Local divan benchmark, not committed: slice 1500.. into 128Ki
u32values with block widths cycling 1 to 16 bits, then canonicalize. Apple M5 Max, median.The kernel call alone takes 131 ns, against 58 ns for a single width.
Testing
compute/slice.rs: ranges within, across and aligned to blocks, to the end, and empty, with primitive and FoR-encoded offsets; kept blocks; nulls and patches; slicing twice; invalid boundaries rejected.Follow-up: blocked kernels for filter, take, compare/between, is_constant and cast.